package dev.ece.suit.loader.models.fbx;

import org.lwjgl.opengl.GL11;

import dev.ece.core.vertex.EBO;
import dev.ece.suit.loader.Face;
import dev.ece.suit.loader.Mesh;

public class FBXMesh extends Mesh {

	public FBXMesh(int materialIndex) {
		super(new int[] {}, materialIndex);
	}

	public static FBXMesh[] parseFBXMesh(FBXJoint[] joints, FBXGeometry[] geometries) {
		FBXMesh[] meshes = new FBXMesh[geometries.length];
		FBXGeometry geometry = null;
		for(int i=0; i<meshes.length; i++) {
			geometry = geometries[i];
			meshes[i] = new FBXMesh(geometry.getMaterialIndex());
			geometry.fillFBXMesh(meshes[i]);
		}
		return meshes;
	}
	
	@Override
	protected EBO createRenderEBO(Face[] faces) {
		return null;
	}

	@Override
	protected void render() {
		GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, this.getCount());
	}

}
